/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.market.web.model;

/**
 *
 * @author ps
 */
public class Item {
    private int id;
    private String name;
    private double price;
    private int qty;

    
    public Item(int id,String name,double price,int qty)
    {
        this.id= id;
        this.name = name;
        this.price = price;
        this.qty = qty;
    }
    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the price
     */
    public double getPrice() {
        return price;
    }

    /**
     * @param price the price to set
     */
    public void setPrice(double price) {
        this.price = price;
    }

    /**
     * @return the qty
     */
    public int getQty() {
        return qty;
    }

    /**
     * @param qty the qty to set
     */
    public void setQty(int qty) {
        this.qty = qty;
    }

    
    public void changeQty(int qty)
    {
        this.qty = qty;
    }

    public double getSubTotal() {
        double amount = 0;
        amount = (this.getQty()* this.getPrice());
        return amount;
    }
    
}
